$i=0
$m=0

# for is not a scope block here for $i and $m

for ($i; $i -le 100 ; $i++) {
    $m=$m+$i
}

write-Host "The sum of 0 to 100 is $m"
Write-Host "The value of i is $i"